home *** CD-ROM | disk | FTP | other *** search
Wrap
Eval function The eval function is a function built-in to JavaScript. It is not a method associated with any object, but is part of the language itself. Syntax eval(expression) Description The eval function takes a JavaScript arthimetic expression as its argument and returns the value of the argument as a number. Example Both of the uses of eval in the following example assign the value 42 to the variable result. x = 6 result = eval((3+3)*7) result = eval(x*7) ------------------------------------------------------------------------ exp method Returns e to the power of its argument, i.e. ex, where x is the argument, and e is Euler's constant, the base of the natural logarithms. Syntax exp(arg) Applies to Math Examples xxx Examples to be supplied. See also log method ------------------------------------------------------------------------ fixed method Causes the calling string object to be displayed in fixed-pitch font in HTML by surrounding it with typewriter text tags, <fixed>... <fixed> Syntax fixed() NOTE: For Beta4, use TT() for this method. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. ------------------------------------------------------------------------ floor method Returns the greatest integer less than or equal to its argument. Syntax floor(arg) Applies to Math Examples xxx Examples to be supplied. See also ceil method ------------------------------------------------------------------------ focus method For password, text, and textArea, gives focus to the object. Syntax focus() Description Use the focus method to navigate to a specific form element and give it focus. You can then either programatically enter a value in the element or let the user enter a value. Applies to password, text, textArea Examples In the following example, the checkPassword function confirms that a user has entered a valid password. If the password is not valid, the focus method returns focus to the password field and the select method highlights it so the user can re-enter the password. function checkPassword(userPass) { if (badPassword) { alert("Please enter your password again.") userPass.focus() userPass.select() } } This example assumes that the password is defined as: <INPUT TYPE=password NAME=userPass>/PRE> See also blur, select methods ------------------------------------------------------------------------ fontcolor method Causes the calling string object to be displayed in the specified color by surrounding it with HTML font color tags, <FONTCOLOR=color>... <FONTCOLOR> Syntax fontcolor(color) The argument to the method, color, must be a string containing a hashmark (#) followed by a triplet of hexadecimal number pairs. These three pairs represent the red, green, and blue values for the desired color, respectively. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. ------------------------------------------------------------------------ fontsize method Causes the calling string object to be displayed in the specified font size by surrounding it with HTML font size tags, <FONTSIZE=size>... <FONTSIZE> Syntax fontsize(size) The argument to the method, size, must be an integer between one and seven. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. See also big, small methods ------------------------------------------------------------------------ forward method Loads the next URL in the history list. Syntax forward() Description This method performs the same action as a user choosing the Forward button in the Navigator. The forward method is the same as go(1). Applies to history Examples xxx Examples to be supplied. See also back, go methods ------------------------------------------------------------------------ getDate method Syntax dateObj.getDate() where dateObj is a date object. Description Returns the day of the month for the date object, an integer between 1 and 31. Applies to Date Examples The second statement below assigns the value 25 to the variable day, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") day = Xmas95.getDate() See also xxx To be supplied. ------------------------------------------------------------------------ getDay method Syntax dateObj.getDay() where dateObj is a date object. Description Returns the day of the week for the date object, an integer corresponding to the day of the week: zero for Sunday, one for Monday, two for Tuesday, and so on. Applies to Date Examples The second statement below assigns the value 1 to weekday, based on the value of the date object Xmas95. This is because December 25, 1995 is a Monday. Xmas95 = new Date("December 25, 1995 23:15:00") weekday = Xmas95.getDay() See also xxx To be supplied. ------------------------------------------------------------------------ getHours method Syntax dateObj.getHours() where dateObj is a date object. Description Returns the hour for the date object, an integer between 0 and 23. Applies to Date Examples The second statement below assigns the value 23 to the variable hours, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") hours = Xmas95.getHours() See also xxx To be supplied. ------------------------------------------------------------------------ getMinutes method Syntax dateObjgetMinute() where dateObj is a date object. Description Returns the minutes in the date object, an integer between 0 and 59. Applies to Date Examples The second statement below assigns the value 15 to the variable minutes, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") minutes = Xmas95.getMinutes() See also xxx To be supplied. ------------------------------------------------------------------------